package com.shundr.shipper.common;

import java.util.ArrayList;
import java.util.List;

import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;

import com.shundr.shipper.R;
import com.shundr.shipper.base.BaseActivity;
import com.shundr.shipper.common.adapter.InvitedAdapter;
import com.shundr.shipper.common.model.InviteInfo;
import com.shundr.shipper.common.util.JsonUtil;
import com.shundr.shipper.common.view.CListView;

/**
 * 已邀请用户 InvitedActivity
 * 
 * @author larry 2015-6-26 下午12:54:54
 * @version 1.0.0
 * 
 */
public class InvitedActivity extends BaseActivity implements OnClickListener {
	private CListView mListView;
	private InvitedAdapter mAdapter;

	private List<InviteInfo> mList;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_car_list);
		mList = new ArrayList<InviteInfo>();
		try {
			String json = getIntent().getStringExtra("json");
			mList.addAll(JsonUtil.getList(json, InviteInfo.class));
		} catch (Exception e) {
			e.printStackTrace();
		}
		initView();
	}

	private void initView() {
		mListView = (CListView) findViewById(R.id.lv_list);
		mAdapter = new InvitedAdapter(mList, mContext);
		mListView.setAdapter(mAdapter);
	}

	@Override
	protected void onDestroy() {
		try {
			mList.clear();
			mList = null;
		} catch (Exception e) {
			e.printStackTrace();
		}
		super.onDestroy();
	}

	@Override
	public void onClick(View v) {
	}

}
